﻿<%@ Page Title="Водители" Language="VB" MasterPageFile="~/adminnew/Layout.master" AutoEventWireup="false" CodeFile="Taxists.aspx.vb" Inherits="AdminNewTaxists" %>

<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder" runat="Server">

    <a href="/adminnew/report.aspx/?type=taxists&isonline=<%=isOnline%>&cityid=<%=cityId %>" download class="btn btn-success pull-right" style="margin-top: 20px;"><span class="glyphicon glyphicon-download-alt" aria-hidden="true"></span>&nbsp;Выгрузить в Excell</a>
    <h2 class="page-header" style="margin: 20px 0 10px 0;"><%=Master.Page.Title%> (всего <%=CType(Master.Page, adminnew_Taxists).total%>)</h2>

    <div>
        <button type="submit" class="btn btn-primary pull-right"><span class="glyphicon glyphicon-ok" aria-hidden="true"></span>&nbsp;Применить</button>

        <div class="input-group pull-right" style="float: left; width: 160px; margin: 0 10px;">
            <span class="input-group-addon">
                <input type="checkbox" name="isonline" <%=IIf(isOnline = "on", "checked", "")%> style="cursor: pointer" />
            </span>
            <input type="text" class="form-control" value="только онлайн" style="cursor: default; background-color: white;" disabled />
        </div>
        <div class="btn-group  pull-right">
            <input type="hidden" name="cityid" value="<%=cityId%>" />
            <button type="button" class="form-control btn btn-default dropdown-toggle" data-toggle="dropdown">
                <span class="sname" style="width: 158px;">
                    <% Dim city = cities.FirstOrDefault(Function(a) a.city_id = cityId)
                        Dim cityname = "Все города"
                        If IsNothing(city) <> True Then
                            cityname = city.city_name
                        End If
                    %><%=cityname %> &nbsp;</span> &nbsp;<span class="caret"></span>
            </button>
            <ul class="dropdown-menu" role="menu" id="cities" style="min-width: 120px;">
                <li title="<%=Guid.Empty%>" <%=IIf(Guid.Empty=cityId,"active","") %>><a href="#" title="Все города">Все города</a></li>
                <%For Each c In cities%>
                <li title="<%=c.city_id%>" <%=IIf(c.city_id=cityId,"active","") %>><a href="#" title="<%=c.city_name%>"><%=c.city_name%></a></li>
                <%Next%>
            </ul>
        </div>
    </div>
    <div style="clear: both; margin-bottom: 10px;"></div>

    <table class="table table-bordered table-hover table-condensed table-striped" style="border: none; border-top: 1px solid #ddd;">
        <thead>
            <tr>
                <th width="45px;">№</th>
                <th>ФИО</th>
                <th>Телефон</th>
                <th>Пароль</th>
                <th>Автомобиль (марка, модель, номер, цвет)</th>
                <th>Регистрация</th>
                <th>Город</th>
                <th>Баланс</th>
                <th width="40px;"></th>
            </tr>
        </thead>
        <tbody>
            <% Dim index = 1%>
            <%For Each taxi In CType(Master.Page, adminnew_Taxists).taxists%>
            <tr>
                <td><%=index %></td>
                <td><a href="/adminnew/taxistinfo.aspx/?taxistid=<%=taxi.taxi_id%>&returlurl=<%=HttpUtility.UrlEncode("/adminnew/taxists.aspx/?isonline=" + isOnline + "&cityid=" + cityId.ToString())%>" title="Подробнее"><%=taxi.taxi_lastname + " " + taxi.taxt_firstname %></a></td>
                <td>+<%=taxi.taxi_phone%></td>
                <td><%=taxi.taxi_password %></td>
                <td><%=(taxi.taxi_marka + " " + taxi.taxi_model + ", " + taxi.taxi_carnumber + ", " + taxi.taxi_color).ToLower()%></td>
                <td><%=taxi.taxi_created.AddHours(3).ToString("d")%></td>
                <td><%=taxi.cities.city_name%></td>
                <td><%=CType(taxi.transfers.Sum(Function(i) i.transfer_amount), Integer)%> тг.</td>
                <td>
                    <a href="/adminnew/taxistinfo.aspx/?taxistid=<%=taxi.taxi_id%>&returlurl=<%=HttpUtility.UrlEncode("/adminnew/taxists.aspx/?isonline=" + isOnline + "&cityid=" + cityId.ToString())%>" type="button" class="btn btn-default btn-sm" title="Подробнее">
                        <span class="glyphicon glyphicon-eye-open" aria-hidden="true"></span>
                    </a>
                </td>
            </tr>
            <%index += 1
            Next%>
        </tbody>
        <tfoot style="border: none;">
            <tr style="border: none;">
                <td colspan="6" style="border: none;">
                    <%-- @Html.Partial("_Paginator", PaginationHelper)--%>
                </td>
            </tr>
        </tfoot>
    </table>

    <script type="text/javascript">
        $(document).ready(function () {
            $('#cities li').click(function () {
                $('input[name=cityid]').val($(this).attr('title'));
                $('.sname').text($(this).find('a').text());
            });
        });
    </script>

</asp:Content>

